<script>
$(function(){
	$("#form_submit").on("click",function(){
		$("#time2").val($("#time1").val());
		$("#comment_form").submit();
	});
})
</script>
<div class="row-fluid">
	<div class="span12">
		<!-- BEGIN EXAMPLE TABLE PORTLET-->
		<div class="portlet box blue">
			<div class="portlet-title">

				<div class="caption"><i class="icon-edit"></i>查看评论</div>

				<div class="tools">

					<a href="javascript:;" class="collapse"></a>

					<a href="#portlet-config" data-toggle="modal" class="config"></a>

					<a href="javascript:;" class="reload"></a>

					<a href="javascript:;" class="remove"></a>

				</div>
			</div>
			<div class="portlet-body">
				<form action="{:U('Comment/checkComment')}" method="post" id="comment_form">
					<div class="input-append">
						<input type="hidden" name="time" id="time2">
						<input class="m-wrap" placeholder="搜索 评论" type="text" name="keyword">

						<button class="btn green" type="submit">搜索</button>

					</div>
									<!-- Button trigger modal -->
					<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" style="float: right;">
					 按日期搜索
					</button>
				</form>
				<!-- Modal -->
				<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
					<div class="modal-dialog" role="document">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal" aria-label="Close">
									<span aria-hidden="true">&times;</span>
								</button>
								<h4 class="modal-title" id="myModalLabel">选择时间</h4>
							</div>
							<div class="modal-body">
								<input type="date" id="time1" value="2017-05-15">
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
								<button type="button" class="btn btn-primary" id="form_submit">确定</button>
							</div>
						</div>
					</div>
				</div>
				<div id="sample_editable_1_wrapper" class="dataTables_wrapper form-inline" role="grid">
					<table class="table table-striped table-hover table-bordered dataTable" id="sample_editable_1" aria-describedby="sample_editable_1_info">
						<thead>
							<tr role="row">
								<th>用户名</th>
								<th>内容</th>
								<th>时间</th>
								<th>编辑</th>
								<th>删除</th>
							</tr>

						</thead>

						<tbody role="alert" aria-live="polite" aria-relevant="all">
							<foreach name="commentList" item="vo" >
								<tr class="odd">

									<td>{$vo['username']}</td>

									<td>{$vo['content']}</td>

									<td>{$vo['time']|date='Y年m月d日 H:i ',###}</td>

									<td><a class="edit" href="javascript:;">编辑</a></td>

									<td><a class="delete" href="{:U('Comment/deleteComment?id='.$vo['Id'])}" onClick="return confirm('是否删除')?true:false;">删除</a></td>
								</tr>
							</foreach>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<!-- END EXAMPLE TABLE PORTLET-->
	</div>
</div>
